﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ResqustOkWithOutMenu.ascx.cs"
    Inherits="com.cngrain.SAFC.Web.res.inc.ResqustOkWithOutMenu" %>
<link href="<%=com.cngrain.SAFC.Common.CommonSet.BaseUrl()+"/res/css/popup/popup.css"%>"
    rel="stylesheet" type="text/css" />

<script src="<%=com.cngrain.SAFC.Common.CommonSet.BaseUrl()%>/res/js/common/common.js"
    type="text/javascript"></script>

<script src="<%=com.cngrain.SAFC.Common.CommonSet.BaseUrl()%>/res/js/common/Dialog.js"
    type="text/javascript"></script>

<div class="popsafe popmodule" id="IssueSuccess" style="display: none; position: absolute;
    z-index: 10001;">
    <h1 id="ShowText">
        提示标题
    </h1>
    <h2 id="ShowHtml">
        提示内容
    </h2>
    <h3>
        <a id="ReturnUrl" href="#">返 回</a><a id="CloseUrl" onclick="msgdialog.Hide();" href="javascript:void(0);">关
            闭</a>
    </h3>
</div>

<script type="text/javascript">
    var msgdialog = new Dialog("IssueSuccess", null, 140, '500');
    var MenuCode = '';
    var node_id = '', node_text = '', node_url = '';
    //初始化内容SuccessInit('#','添加成功！','添加一条记录','返回','003001','')
    function SuccessInit(defUrl, showText, showHtml, aText, closeUrl, inode_id, inode_text, inode_url) {

        if (typeof (inode_id) != 'undefined' && inode_id != '') {
            node_id = inode_id;
            node_text = inode_text;
            node_url = inode_url;
            setEvent();
        } else {
            document.getElementById('ReturnUrl').href = defUrl;
        }

        document.getElementById('ReturnUrl').innerHTML = aText;
        document.getElementById('ShowText').innerHTML = showText;
        document.getElementById('ShowHtml').innerHTML = showHtml;
        if (typeof (closeUrl) != 'undefined' && closeUrl != '') {
            document.getElementById('CloseUrl').href = closeUrl;
        }
        else {
            document.getElementById('CloseUrl').href = 'javascript:void(0);';
        }
        msgdialog.ShowAndMask();
    }

    function openMenuById() {
        msgdialog.Hide();
        var n = window.top.center.getComponent(node_id);

        if (!n) { //判断是否已经打开该面板
            n = window.top.center.add({
                xtype: "panel",
                id: node_id,
                iconCls: 'totalicon',
                title: node_text,
                closable: true,  //通过html载入目标页
                html: '<iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="' + node_url + '"></iframe>'
            });
        }
        else {
            window.top.center.remove(n);
            n = window.top.center.add({
                xtype: "panel",
                id: node_id,
                iconCls: 'totalicon',
                title: node_text,
                closable: true,  //通过html载入目标页
                html: '<iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="' + node_url + '"></iframe>'
            });
        }
        window.top.center.setActiveTab(n);
    }
    function setEvent() {
        var obj = document.getElementById("ReturnUrl");
        obj.href = 'javascript:void(0);';

        if (window.addEventListener) {
            //其他浏览器的事件代码: Mozilla, Netscape, Firefox
            //添加的事件的顺序即执行顺序 //注意用 addEventListener 添加带on的事件，不用加on
            obj.addEventListener('click', openMenuById, false);
        }
        else {
            //IE 的事件代码 在原先事件上添加 add 方法
            obj.attachEvent('onclick', openMenuById);
        }
    }

</script>

